import grails.util.GrailsUtil
import gestorcondominio.User

class BootStrap {
	def init = { servletContext ->
		switch(GrailsUtil.environment){
			case "development":
				def admin = new User(login:"admin",
				password:"password",
				role:"admin")
				admin.save()
				if(admin.hasErrors()){
					println admin.errors
				}
				def jdoe = new User(login:"user",
						password:"password",
						role:"user")
				jdoe.save()
				if(jdoe.hasErrors()){
					println jdoe.errors
				}
		}
		def destroy = {
		}
	}
}
